package com.horsen.common.util;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 返回码枚举类
 *
 * @author Horsen
 */
@Getter
@AllArgsConstructor
public enum ResultCodeEnum {
    /**
     * 偏不写注释
     */
    SUCCESS(true, 20000, "成功"),

    UNKNOWN_REASON(false, 20001, "未知错误"),
    BAD_SQL_GRAMMAR(false, 21002, "SQL语法错误"),
    DUPLICATE_KEY_EXCEPTION(false, 21003, "主键重复错误"),
    JSON_PARSE_ERROR(false, 21004, "JSON解析异常"),
    PARAM_ERROR(false, 21005, "参数不正确"),
    FILE_UPLOAD_ERROR(false, 21006, "文件上传错误"),
    FILE_DELETE_ERROR(false, 21007, "文件删除错误"),
    EXCEL_DATA_IMPORT_ERROR(false, 21008, "Excel数据导入错误"),

    VIDEO_UPLOAD_ALIYUN_ERROR(false, 22001, "视频上传至阿里云失败"),
    VIDEO_UPLOAD_TOMCAT_ERROR(false, 22002, "视频上传至tomcat失败"),
    VIDEO_DELETE_ALIYUN_ERROR(false, 22003, "阿里云视频删除失败"),
    FETCH_VIDEO_UPLOAD_AUTH_ERROR(false, 22004, "获取上传地址和凭证失败"),
    REFRESH_VIDEO_UPLOAD_AUTH_ERROR(false, 22005, "刷新上传地址和凭证失败"),
    FETCH_PLAY_AUTH_ERROR(false, 22006, "获取播放凭证失败"),

    URL_ENCODE_FAILED(false, 23001, "URL编码失败"),
    ILLEGAL_CALLBACK_REQUEST_ERROR(false, 23002, "非法回调请求"),
    FETCH_ACCESS_TOKEN_FAILED(false, 23003, "获取accessToken失败"),
    FETCH_USER_INFO_ERROR(false, 23004, "获取用户信息失败"),
    LOGIN_ERROR(false, 23005, "登录失败"),

    ORDER_EXIST_ERROR(false, 25003, "课程已购买"),

    GATEWAY_ERROR(false, 26000, "服务不能访问"),

    LOGIN_PASSWORD_ERROR(false, 28001, "密码不正确"),
    LOGIN_DISABLED_ERROR(false, 28002, "用户已被封禁"),
    REGISTER_PHONE_ERROR(false, 28003, "手机号已被注册"),
    REGISTER_EMAIL_ERROR(false, 28004, "邮箱已被注册"),

    LOGIN_AUTH(false, 28005, "需要登录"),
    LOGIN_ACL(false, 28006, "没有权限"),

    REDIS_CONNECTION_ERROR(false, 29001, "Redis连接错误");

    private final Boolean success;

    private final Integer code;

    private final String message;

}
